package com.ruoyi.common.utils;

import java.sql.Timestamp;
import java.util.Calendar;

/**
 * AUTHOR : CREATED BY DALE MAO ON 2018/7/11
 * DESCRIPTION:
 * Time:2018/7/11 ----- ${Time}
 **/
public class MemberUtil {




    public static long getAllDayChuo(int TimeLong){

        Timestamp timestamp = new Timestamp(System.currentTimeMillis());
        Calendar calendar = Calendar.getInstance();
        int year = timestamp.getYear();
        //System.out.println(year);
        int month = timestamp.getMonth();
        //System.out.println(month);
        int date = timestamp.getDate();
        //System.out.println(date);
        int endMonthDay =timestamp.getDate();
        int curMonthlossDay =calendar.getActualMaximum(calendar.DATE)-timestamp.getDate();
        int lossMonthDay=0;

        for (int i = 0; i < TimeLong-1; i++) {
            month=month+1;
            if(month > 11){
                year =year+1;
                month=1;
                System.out.println("增加后的年份"+year);
            }
            System.out.println(month);
            calendar.set(year, month, date);
            int maxDay = calendar.getActualMaximum(Calendar.DAY_OF_MONTH);
            lossMonthDay=lossMonthDay+maxDay;

        }
        int allDay =lossMonthDay+endMonthDay+curMonthlossDay;
        long chuo =allDay*3600*24;
        return chuo;

    }



}
